import { CONFIG } from '@/config/env/dotenv';
import { CosUploadFile } from './cos';
import { DefaultUploadFile } from './default-upload';
import { UploadFile } from './upload.interface';

export function getUploadInstance(): UploadFile {
  switch (CONFIG['MY_NEST_APP_UPLOAD_FILE_TYPE']) {
    case 'cos':
      return new CosUploadFile();
    case 'default':
      return new DefaultUploadFile();
    default:
      return new DefaultUploadFile();
  }
}
